package com.ftwj.demo.base.common.inter;

import java.util.List;
import java.util.Map;

import com.ftwj.demo.base.util.PageInfoBean;
import com.ftwj.demo.base.wrapper.ConditionWrapper;
import com.ftwj.demo.base.wrapper.QueryWrapper;
import com.ftwj.demo.base.wrapper.UpdateWrapper;

public interface ServiceInterface<T,K> {

	int add(T t, Boolean ignore);

	int add(T t);

	int addAndGetId(T t, Boolean ignore);

	int addAndGetId(T t);

	int delById(K primarykey);

	int delByIds(Object... keys);

	int delByIds(List<K> keys);

	int delByExample(T t);
	
	int delByConditions(ConditionWrapper wrapper);

	int remo(K primarykey);

	int remoByIds(Object... keys);

	int remoByIds(List<K> keys);

	int remoByExample(T t);

	int remoByConditions(QueryWrapper wrapper);

	int save(T t);

	int save(T t, Boolean ignore);
	
	int saveByExample(T t, String... fieldArrays);

	int saveByExample(T t, Boolean ignore, String... fieldArrays);
	
	int saveByExample(T t, List<String> fieldList);

	int saveByExample(T t, List<String> fieldList, Boolean ignore);
	
	int saveByConditions(UpdateWrapper wrapper);

	T find(K primarykey);

	Map<String, Object> findMap(K primarykey);

	List<T> findListByIds(Object... primarykey);
	
	List<Map<String,Object>> findListMapByIds(Object... primarykey);

	T findByUniteId(Object... primarykey);
	
	Map<String, Object> findMapByUniteId(Object... primarykey);

	List<T> findListByExample(T t);

	List<Map<String, Object>> findListMapByExample(T t);
	
	T findByExample(T t);
	
	Map<String, Object> findMapByExample(T t);
	
	T findByConditions(QueryWrapper wrapper);
	
	Map<String, Object> findMapByConditions(QueryWrapper wrapper);

	List<T> findListByConditions(QueryWrapper wrapper);

	List<Map<String, Object>> findListMapByConditions(QueryWrapper wrapper);

	List<T> findListByConditions(T t, QueryWrapper wrapper);

	List<Map<String, Object>> findListMapByConditions(T t, QueryWrapper wrapper);

	Integer findCount(QueryWrapper wrapper);

	PageInfoBean page(int curPage, int perPage);

	PageInfoBean pageMap(int curPage, int perPage);

	PageInfoBean pageByExample(T t, PageInfoBean page);

	PageInfoBean pageMapByExample(T t, PageInfoBean page);

	PageInfoBean pageByConditions(QueryWrapper wrapper, PageInfoBean page);

	PageInfoBean pageMapByConditions(QueryWrapper wrapper, PageInfoBean page);
	
	PageInfoBean pageByConditions(T t, QueryWrapper wrapper, PageInfoBean page);

	PageInfoBean pageMapByConditions(T t, QueryWrapper wrapper, PageInfoBean page);

}
